#ifndef _SYSTEM_LED_H_
#define _SYSTEM_LED_H_

#include "stm32f4xx.h"

#define SYSTEM_PORT_RCC RCC_AHB1Periph_GPIOC
#define SYSTEM_PORT GPIOC
#define SYSTEM_PIN GPIO_Pin_2

#define NET_STATUS_PORT_RCC RCC_AHB1Periph_GPIOF
#define NET_STATUS_PORT GPIOF
#define NET_STATUS_PIN GPIO_Pin_10

#define WARNING_PORT_RCC RCC_AHB1Periph_GPIOB
#define WARNING_PORT GPIOB
#define WARNING_PIN GPIO_Pin_0
void system_led_init(uint8_t led_flash_type);
void run_led_init(void);
void system_net_status_init(void);
void system_warning_init(void);

void run_led_toggle(void);
void system_net_status_toggle(void);
void system_warning_toggle(void);

void run_led_on(void);
void run_led_off(void);

void net_status_led_on(void);
void net_status_led_off(void);

void warning_led_on(void);
void warning_led_off(void);

void system_led_blink_faster(void);
void system_led_blink_slower(void);
// 定时间隔枚举
typedef enum
{
    TIM8_INTERVAL_50MS = 50,  // 100ms间隔
    TIM8_INTERVAL_100MS = 100 // 500ms间隔
} TIM8_IntervalTypeDef;
void TIM8_Init(TIM8_IntervalTypeDef init_interval);
void TIM8_SetInterval(TIM8_IntervalTypeDef new_interval);

#endif
